﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Miao.Stand
{
    /// <summary>
    /// 点击后开始持续性技能，持续期间Cost扣除
    /// </summary>
    abstract public class StandAbilityContinue : StandAbility
    {
        public Action OnContinueEnd;
        abstract public bool Continue { get; set; }

        public StandAbilityContinue(StandPawn stand) : base(stand)
        {

        }
        public override void Tick()
        {
            base.Tick();
            if (Continue)
            {
                stand.standPower.PowerConsume(def.cost);
                if (stand.standPower.CurLevel < 0.1f)
                {
                    Continue = false;
                    OnContinueEnd?.Invoke();
                }
            }
        }
    }
}
